## ── Attaching packages ────────────────────────────────── tidyverse 1.2.1 ──
## ✔ ggplot2 3.0.0     ✔ purrr   0.2.5
## ✔ tibble  1.4.2     ✔ dplyr   0.7.6
## ✔ tidyr   0.8.1     ✔ stringr 1.3.0
## ✔ readr   1.1.1     ✔ forcats 0.2.0
## ── Conflicts ───────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## Loading required package: RColorBrewer
## 
## Attaching package: 'igraph'
## The following objects are masked from 'package:dplyr':
## 
##     as_data_frame, groups, union
## The following objects are masked from 'package:purrr':
## 
##     compose, simplify
## The following object is masked from 'package:tidyr':
## 
##     crossing
## The following object is masked from 'package:tibble':
## 
##     as_data_frame
## The following objects are masked from 'package:stats':
## 
##     decompose, spectrum
## The following object is masked from 'package:base':
## 
##     union
## Loading required package: NLP
## 
## Attaching package: 'NLP'
## The following object is masked from 'package:ggplot2':
## 
##     annotate
## Loading required package: lattice
## 
## Attaching package: 'caret'
## The following object is masked from 'package:purrr':
## 
##     lift
## 
## Attaching package: 'text2vec'
## The following object is masked from 'package:topicmodels':
## 
##     perplexity
## The following object is masked from 'package:igraph':
## 
##     normalize
## 
## Attaching package: 'data.table'
## The following objects are masked from 'package:dplyr':
## 
##     between, first, last
## The following object is masked from 'package:purrr':
## 
##     transpose
## 
## Attaching package: 'reshape2'
## The following objects are masked from 'package:data.table':
## 
##     dcast, melt
## The following object is masked from 'package:tidyr':
## 
##     smiths
## 
## Attaching package: 'cowplot'
## The following object is masked from 'package:ggplot2':
## 
##     ggsave
## 
## Attaching package: 'ggthemes'
## The following object is masked from 'package:cowplot':
## 
##     theme_map

in this phaze I first remove punctuation , website , … other unimportant word in posts .

data = read_csv("mbti_1.csv")
## Parsed with column specification:
## cols(
##   type = col_character(),
##   posts = col_character()
## )
clean=function(x){
  x=str_replace_all(x,'[^[:alnum:]]',' ')
  x=gsub("[\t]{2,}"," ",x)
  x=gsub("[[:digit:]]"," ",x)
  x=gsub("http.*"," ",x)
  return(x)
}
head(data)
## # A tibble: 6 x 2
##   type  posts                                                             
##   <chr> <chr>                                                             
## 1 INFJ  'http://www.youtube.com/watch?v=qsXHcwe3krw|||http://41.media.tum…
## 2 ENTP  'I'm finding the lack of me in these posts very alarming.|||Sex c…
## 3 INTP  'Good one  _____   https://www.youtube.com/watch?v=fHiGbolFFGw|||…
## 4 INTJ  'Dear INTP,   I enjoyed our conversation the other day.  Esoteric…
## 5 ENTJ  'You're fired.|||That's another silly misconception. That approac…
## 6 INTJ  '18/37 @.@|||Science  is not perfect. No scientist claims that it…
types <- data.frame(type =data$type )
sentences = str_split_fixed(data$posts,"\\|\\|\\|",50)
type_sen = cbind(types,sentences)
### get list that each element is for one type
type_name <- types %>% distinct() %>% unlist()
clean_type_sen <- type_sen
clean_type_sen[,2:51]<- lapply(type_sen[,2:51],clean)
head(clean_type_sen)
##   type
## 1 INFJ
## 2 ENTP
## 3 INTP
## 4 INTJ
## 5 ENTJ
## 6 INTJ
##                                                                                                                                                                                               1
## 1                                                                                                                                                                                              
## 2                                                                                                                                      I m finding the lack of me in these posts very alarming 
## 3                                                                                                                                                                           Good one           
## 4  Dear INTP    I enjoyed our conversation the other day   Esoteric gabbing about the nature of the universe and the idea that every rule and social code being arbitrary constructs created   
## 5                                                                                                                                                                                 You re fired 
## 6                                                                                                                                                                                              
##                                                                                                                                                                                                      2
## 1                                                                                                                                                                                                     
## 2 Sex can be boring if it s in the same position often  For example me and my girlfriend are currently in an environment where we have to creatively use cowgirl and missionary  There isn t enough   
## 3                                                                                                                                   Of course  to which I say I know  that s my blessing and my curse 
## 4                                                                                                                                                 Dear ENTJ sub    Long time no see   Sincerely  Alpha
## 5       That s another silly misconception  That approaching is logically is going to be the key to unlocking whatever it is you think you are entitled to    Nobody wants to be approached with BS   
## 6  Science  is not perfect  No scientist claims that it is  or that scientific  information will not be revised as we discover new things   Rational  thinking has been very useful to our society    
##                                                                                                                                                                                                       3
## 1                                                                                                                                                                              enfp and intj moments   
## 2                                                                                                                                                                  Giving new meaning to  Game  theory 
## 3 Does being absolutely positive that you and your best friend could be an amazing couple count  If so  than yes    Or it s more I could be madly in love in case I reconciled my feelings  which at   
## 4                                                                                                                   None of them  All other types hurt in deep existential ways that I want no part of 
## 5                            But guys    he REALLY wants to go on a super duper long ass vacation  C mon guys  His boss just doesn t listen or get it  He even approached him logically and everything 
## 6                                                                                                                                             INFP  Edgar Allen Poe was an INFP and he s in your siggy 
##                                                                                                                                                                                                        4
## 1                                                                                                                                          What has been the most life changing experience in your life 
## 2        Hello  ENTP Grin   That s all it takes  Than we converse and they do most of the flirting while I acknowledge their presence and return their words with smooth wordplay and more cheeky grins 
## 3                                                                                                                                                                    No  I didn t  thank you for a link 
## 4                                                                                                          Probably a sliding scale that depends on individual preferences  like everything in humanity 
## 5                                                                                                                                                             Never mind  Just go on permanent vacation 
## 6 People see the obvious Fi and are quick to put her as INFP  I agree that she has no Ne  I see her as an ISFP  Compare her to Haku  definite INFP   She is flat through most of Naruto   but I don t   
##                                                                                                                                                                                                           5
## 1                                                                                                                                                                                                          
## 2                                                                                                                                                         This   Lack of Balance and Hand Eye Coordination 
## 3 So called Ti Si loop  and it can stem from any current topic obsession  can be deadly  It s like when you re stuck in your own thoughts  and your mind just wanders in circles  Feels truly terrible     
## 4                                                                                                                                                        Draco Malfoy also  I d say he s either     or     
## 5       Two months  I wouldn t be crazy about the idea  If you are really his best employee  then that s what may be cooking him  Who wants their most reliable asset gone for that long   ENTJ employer   
## 6                                                                                                                                                                        Lets get this party started       
##                                                                                                                                                                                                           6
## 1                                                                                                                                                                      May the PerC Experience immerse you 
## 2    Real IQ test I score      Internet IQ tests are funny  I score    s or higher   Now  like the former responses of this thread I will mention that I don t believe in the IQ test  Before you banish   
## 3  Have you noticed how peculiar vegetation can be  All you have to do is look down at the grass  dozens of different plant species there     And now imagine that hundreds of years later  when if soil   
## 4 I m either     or      though in which stacking to me is a somewhat arbitrary distinction to make as I believe that the core indicates primary motivation and has a hand in every action  Therefore  a   
## 5                                                                                                                                              Lol  Its not like our views were unsolicited  What a victim 
## 6 I did not say it disproved God  I merely said that I found such methods disturbing  Although  it does bring up certain questions  God is in control of the universe  and the governments of the world    
##                                                                                                                                                                                                           7
## 1                                                                                           The last thing my INFJ friend posted on his facebook before committing suicide the next day  Rest in peace     
## 2 You know you re an ENTP when you vanish from a site for a year and a half  return  and find people are still commenting on your posts and liking your ideas thoughts  You know you re an ENTP when you   
## 3                                                                                                                                                                        The Smiths   Never Had No One Ever
## 4  I m not particularly introverted or extraverted  personally  That said  I would say I m somewhat unphased by either social interactions or being alone  What I d say I crave more so than anything is   
## 5                                                                                                                                                  Sometimes I just really like impoverished rap music     
## 6     Surprisingly  I could not find a thread about this on perc even with Google  So  here you go   Watch Jesus Camp online   Watch Movies Online  Full Movies  Download  I was disturbed watching this   
##                                                                                                                                                                                                            8
## 1   Hello ENFJ   Sorry to hear of your distress  It s only natural for a relationship to not be perfection all the time in every moment of existence  Try to figure the hard times as times of growth  as   
## 2                                                                                                                                                                                                           
## 3                                                                                                                                                   I often find myself spotting faces on marble tiles wood 
## 4       Dear Type   INFP   Your absolute admiration of me is refreshing  You re a great girlfriend and I wish we both didn t have such busy schedules so we could be around one another more often   Keep   
## 5 I probably would have lost it too  His stonewalling was insignificant  He was being an idiot over semantics that didn t have any impact on anything  It s one thing to stone wall on critical shit  but   
## 6      A metaphysical gun  Hell  held to someone s head can be just as effective as an actual gun   Do you not find these methods disturbing  Watch Jesus Camp online   Watch Movies Online  Full Movies    
##                                                                                                                                                                                                        9
## 1                                                                                                                                                                                                       
## 2                                                                                                                                                                                                       
## 3                                                                                                                          This   year old sentence is an incredibly accurate and beautiful description 
## 4                                                                                still means about      people  I ve probably seen     others today  I never understood fascination by virtue of rarity 
## 5                                                                                                                                     I would have just taken the project and gave them something later 
## 6 Unstable is not the right word  We are usually pretty emotionally flat lined  But  when we do have to deal with our own emotions we can be very bad at it  In high school my feelings of attraction   
##                                                                                                                                                                                                        10
## 1                                                                                                                                                                                      Welcome and stuff 
## 2         I over think things sometimes  I go by the old Sherlock Holmes quote   Perhaps  when a man has special knowledge and special powers like my  own  it rather encourages him to seek a complex   
## 3                                                      I haven t visited this website in the last   years  So whoever reads this  and maybe even remembers me  which I highly doubt   hi                 
## 4                                                                                                                                                               So  you re on the ESFJ train also  right 
## 5                                                                                                              The court deposition wasn t a skit  That actually happened  It was a verbatim reenactment 
## 6 Well  I went to someone s wedding and dipped everything in the chocolate fountain and ate it  I dipped the fruit  the fish  and even the Hershey s kisses  And I drank two little jars of honey they   
##                                                                                                                                                                                                          11
## 1                                                                                                                                                                                                          
## 2                                                                                                                                                                       cheshirewolf tumblr com  So is I  D
## 3                                                            When you sit in your garden until       PM writing songs  and sing them  together with dozens of crickets  while playing your acoustic guitar 
## 4 I have toyed with the idea of the OP being an extrovert also for awhile now  actually  After many conversations with him  however I m disinclined to believe it due to OP being much too close with Fi   
## 5                                                                                                                                                                                              And her ass 
## 6   That post you  quoted was from two and a half years ago  Since then  I ve come to a better explanation   INTPs may not be as externally certain as INTJs  but they are more certain internally  They   
##                                                                                                                                                                                                          12
## 1 Prozac  wellbrutin  at least thirty minutes of moving your legs  and I don t mean moving them while sitting in your same desk chair   weed in moderation  maybe try edibles as a healthier alternative   
## 2                                                                                                                                                                                                      post
## 3                                                                                                                                                          This is the most INTP ish thread I ve ever seen 
## 4                                                                                                                                                                                                Still ESFJ
## 5    I ll flirt a woman for a piece of candy at the grocery store  Of course  I use whatever I have at my disposal to get what I want in the most efficient manner possible  If that means flirting that   
## 6  This is how I deal with the INFP I m in a relationship with   I am often tempted to avoid hurting them even if it means fudging the truth  telling them only what they want to hear  If I do that  it   
##                                                                                                                                                                                                       13
## 1 Basically come up with three items you ve determined that each type  or whichever types you want to do  would more than likely use  given each types  cognitive functions and whatnot  when left by   
## 2     Not really  I ve never thought of E I or J P as real functions   I judge myself on what I use  I use Ne and Ti as my dominates  Fe for emotions and rarely Si  I also use Ni due to me strength   
## 3                                                                                        I wouldn t be able to look at the painting for the entire life if I knew that I picked it over the human being 
## 4                                                                                                                                                     I disagree   Definite ESFJ  Fe  Si ALL up in this 
## 5                                                                                                                                                                                                       
## 6                                                                Never heard of it till now  I watch a loooot of anime  but I get it from animedreaming tv mostly  I am not a member of any anime board 
##                                                                                                                                                                                                           14
## 1        All things in moderation   Sims is indeed a video game  and a good one at that  Note  a good one at that is somewhat subjective in that I am not completely promoting the death of any given Sim   
## 2   You know though  That was ingenious  After saying it I really want to try it and see what happens with me playing a first person shooter in the back while we drive around  I want to see the look on   
## 3          I was drawing a background for my animation on which I m working right now   it should have been Mars   But I felt obligated to make Mark Watneyx  s postcard from it  D  If you read the book   
## 4                                                                                                                                            Where have you been   Your mother and I have been worried sick 
## 5 Yes  In the comments she gave more info  then was shut down because she went from having a crush on her boss and wanted to know how to impress him  to her boss is married and she wasn t interested  I   
## 6                                                                The legs are nice  but her expression is all wrong  That is not her private sad face  I don t know what it is  See  I have her evil grin  B
##                                                                                                                                    15
## 1              Dear ENFP   What were your favorite video games growing up and what are your now  current favorite video games   cool 
## 2 out of all of them the rock paper one is the best  It makes me lol   You guys are lucky  D I m really high up on the tumblr system 
## 3                             I started to make comics about turtle Gordon and unicorn Chimes   here you can see two first stories   
## 4                                                                                                  Similar feelings concerning ENTPs 
## 5                                                                                                         What s this we thing about 
## 6                                     Kokiri Connect  Becuase I couldn t rememeber how to spell Kokoro Connect so I let Google do it 
##                                                                                                                                                                                                          16
## 1                                                                                                                                                                                                          
## 2 So did you hear about that new first person shooter game  I ve been rocking the hell out of the soundtrack on my auto sound equipment that will shake the heavens  We managed to put a couple PS  s in   
## 3 INTJ Recently I started to post my comics about two friends   turtle Gordon and unicorn Chimes  Before that  I just posted stuff that interested me  but from now on I ll try to include only my works   
## 4                                                                                        I collect shoes  I do so because I like status and nothing communicates such a thing as much as a pair of Jordans 
## 5          Callaendia are you the same INFP girl who was on the ENTJ Facebook forum with this similar question  I just have to ask because the times are so close together  and the scenario is so similar 
## 6                                                                                         Inaba from Kokoro Connect  Because I relate to her and I enjoy looking at her  I have to look at my avatar alot  
##                                                                                                                                                                                                         17
## 1                                                                                                                                                                         It appears to be too late   sad 
## 2                                  No  The way he connected things was very Ne  Ne dominates are just as aware of their environments as Se dominates   Example  Shawn Spencer or Patrick Jane  Both ENTPs 
## 3 Probably we could work together on a new model   I m an expert in abrupt explosions of laughter upon various weird stuff  That happens because of peculiar sense of humor   so peculiar that not much   
## 4                                                                                                                                                                     Sure  Let s get weird     Back  Off 
## 5                                                                                                                                                                                                        X
## 6                                                                                                        I d like to see someone react when they are told they have   hippopotomonstrosesquipedaliophobia 
##                                                                                                                                                                                                           18
## 1                                                                                                                                                                    There s someone out there for everyone 
## 2 Well charlie I will be the first to admit I do get jealous like you do  I chalk it up to my  w  heart mixed with my dominate  w    s and  s both like to be noticed    s like to be known  not the same   
## 3   Hellooo Nah  you can touch it  Everyone thinks that it s scared or sad  but that s not true   in fact it has an absolutely neutral face  And this kitten actually really likes patting and hugs  only   
## 4                                                                                                                                                                                                    Best   
## 5                                                                                                                                    I do not modify myself to suit others  however I do like the spotlight 
## 6  She doesn t trust you or respect you  A break would be good to test if she will change  If she doesn t  you have to think about what will make you happy in the long term  Next time  establish ground   
##                                                                                                                                                                                                       19
## 1                                                                                                                                                         Wait    I thought confidence was a good thing 
## 2                                                                    D I ll upload the same clip with the mic away from my mouth  Than you won t hear anything   Ninja Assassin style but with splatter 
## 3 Well   kind of  As it was already mentioned  sometimes because of Ni it s hard to convey complex stuff which pops up in your head in whimsical compilations of shapes and pictures only with words    
## 4                                                                                                                                                                      Insert other into previous post  
## 5                                                    I think the easiest and most efficient approach is a tarp  jigsaw  and mulcher  But that s just my personal preference  Not all ENTJs are the same 
## 6  I don t think any INTJ is not going to do this if they have a choice  Though  until I got the internet in my late teens I didn t explore many subjects I was interested in in depth  Of course  it   
##                                                                                                                                                                                                          20
## 1 I just cherish the time of solitude b c i revel within my inner world more whereas most other time i d be workin    just enjoy the me time while you can  Don t worry  people will always be around to   
## 2                                                                                       Tik Tok is a really great song  As long as you can mental block out the singer  I love the beat it makes me bounce 
## 3                                                                                                                                               I think this kitten would be very appropriate here         
## 4                                                                                                                                               Wow  don t nobody got time fo  dat     Jk  u kno u mah boi 
## 5                                                                                                                                                                                 Just don t hump my leg   
## 6                                                                                               No  I don t smoke  I have an addictive personality  and I don t think I would be able to stop if I started 
##                                                                                                                                                                                                        21
## 1                                                                                                                                 Yo entp ladies    if you re into a complimentary personality well  hey 
## 2                                                                                             drop io v swck    D Mic really close to my mouth and smokin aces  assassins ball playing in the background 
## 3                                                                                                                                                                                                        
## 4           Well  as I m sure everyone knows  being social primary doesn t necessarily equal being social  I like other people just fine  but lately I ve been on a bit of a break when it comes to my   
## 5                                                                                                                                                             What are you like a chihuahua or some shit 
## 6 Destroying his reputation by revealing what he has done could cause him to lose a lot of power    but if people knew things he had done  a certain person would kill him and end up in jail    There   
##                                                                                                                                                                                                  22
## 1                                                                                               when your main social outlet is xbox live conversations and even then you verbally fatigue quickly 
## 2                                                                                                                                 Sociable     extrovert  I m an extrovert and I m not sociable    
## 3                         GOOD NIGHT everyone out there  Even if for someone there is morning right now   nights always supersede mornings   And people say good night in order to meet next day   
## 4                                                                    That s pretty crappy of her  Your sex life is definitely not her business  If I were you  I d definitely talk to her about it 
## 5                                                                  I once dumped a girl in college who I was having a   month romp with over making me late for class  She said I was petty for it 
## 6 People like people like themselves  this is the number   indicator of attraction  Seeing as most people are sensors it is not surprising that they do not care for my personality   Woman have   
##                                                                                                                                                                                                       23
## 1                                                                                                                                                                                                       
## 2                            Sherlock in the movie was an ENTP  Normally he s played as a EXTJ  In the books he s an ESTJ   As I said  The movie looked good except for it being called sherlock holmes 
## 3 Oh  that movie    It s awesome Thank you  Hope you had good sleep in the air  anyway  I m wishing you good night for the next night ahead   hopefully it will be on land   Good people deserve good   
## 4    Yeah  I had a lot longer to think about it  That said  I don t think you re Te  so if we operate under the assumptions in the OP  you re INFJ because nothing else makes sense  I m not saying I   
## 5                                                                                                                                                                                            DEAD XD    
## 6  My best friend is an INTJ  We have so much in common even for two INTJs  she understands me better than anyone  It took a loooong time for us to become close  We put up a lot of barriers   I get   
##                                                                                                                                                                                                      24
## 1                                                                                                                                                                                                      
## 2                                                                                                                                                                                                      
## 3                                                                                                                                                                                                      
## 4                                                                                               Whether or not you actually are  your mom makes fun of you for being a virgin  Is this playful teasing 
## 5                                                                                                         MBTIPC perfect  I don t like dealing with middle men either  You can talk directly to me     
## 6 I can tell you about a sociopath I know in real life  Not an INTJ  an ENTP or INTP    Tells all his problems to people shortly after meeting them to attempt to gain their sympathy so they can be   
##                                                                                                                                                                                                      25
## 1                                                                                                                                                         Banned because this thread requires it of me 
## 2  Oh  I never had fear of kissing a guy  I will kiss an animal too  So there was nothing to vanish  Just personal taste and me not liking it   The guy I kissed didn t know me  It was one of those   
## 3                                                                           Well  other people who may be wondering about an issue from the name of the topic will find your response helpful anyway   
## 4 Just stab in the dark here  I don t think that s Te under the hood  If this here is all I m given to work with  I d have to say INFJ   Compare your idea of  logic  to mine   Logic is a series of   
## 5                                                                                                                                                                           I can sell you the dream   
## 6  Light  at least in the beggning  and Lelouch did ultimately have good goals  even if their methods were evil   Lelouch did seem to feel remorse at times  a sociopath would never consider taking   
##                                                                                                                                                                                                          26
## 1                                                               Get high in backyard  roast and eat marshmellows in backyard while conversing over something intellectual  followed by massages and kisses 
## 2 Sounds pretty much like my area and what I m going through right now trying to figure out which way I want to take my life  I want to do so many things  The biggest problem is that I know if I don t   
## 3                                                                                                                                                                   This  Finally someone mentioned that   
## 4                                                                                                                                                                                What makes the most sense 
## 5                                                                                                                                                                                             LOL DEAD  Ha 
## 6   Nobody panics when things go  according to plan  Even if the plan is horrifying  If tomorrow I tell  the press that like a gang banger  will get shot  or a truckload of  soldiers will be blown up    
##                                                                                                                                                                                                         27
## 1                                                                                                                                                                                                         
## 2  D I was operating under the impression that you were female  I never looked at your boxy  Okay  I help out my gay friends all the time and one of them has developed a little crush on me  I get red   
## 3                                                               I still see creatures faces in a maze of various random patterns  It can be amusing sometimes   It s a very handy skill when you re bored 
## 4        Tentatively INTJ  Still reading   EDIT  So far  I am of the belief that you re most of the things you say you are  I appreciate the level of detail   EDIT  Also relatively certain you are Ni   
## 5    The point is that when you are making a point of thinking critically but not thinking beyond common sense  you aren t using your brain  A little bit of effort now to have an understanding of the   
## 6     Code Geass     Steins  Gate  It was hardest to pick between this and Geass  but I  think Geass just barely beats it  I will say it is very slow in the  beginning  but everything that happens in   
##                                                                                                                                                                                                        28
## 1                                                                                                                                                                                                        
## 2 T T You just described me  and I m living the worst nightmare  I m trapped in one place with one one around  Only dull woods  If I was a serial killer this would be the perfect place but sadly I m   
## 3                                Oh  I didn t know that   What a pity   Why not sacrifice whole supermarket  then  We can decide which Walmart will be the best  I think the biggest one would be great  
## 4                                                                                                                  Refreshing self with reading about instinctual variants   God  I m a hard social type 
## 5       That s just common sense  No  that s just a value judgement backed by popular opinion from social stupidity laziness  That s only doing what works instead of pushing harder and doing what is   
## 6 Looking back at this post from     years ago    Emil  Asahina  and Hinata are actually ISFPs  Maybe Kimmimaro and Alphonse as well   I really don t know Li Xingke s type    its been awhile since I   
##                                                                                                                                                                                                        29
## 1                                                                                                                                                                                                        
## 2                                           TBH  and biased  sounds like a shadowed INFP  I think maybe he was hurt and turned ESTJ  I can tell because he has some of the typical INFP traits left over 
## 3                                                                                  yippy  Here you go          He thinks that the fire is delicious  Should I sacrifice tofu  I don t like to waste food 
## 4                                                                                                     WOW  Useful thought you had there  Wanna know what my favorite part was   The fact that it ended   
## 5                                                                                                            When it comes to children  they either cry or climb all over me  There is never a gray area 
## 6 Focus on learning the system  and the details should fall into place as you go along  For example  learning C    I read about how it worked  then wrote some programs and only bothered figuring out   
##                                                                                                                                                                                                         30
## 1                                                                                                                                 Banned for too many b s in that sentence  How could you  Think of the B 
## 2  Checks list  I m sorry  It seems that you have came at a bad time  We ve already reached our quota of INFJs  However  being you re female and I like females I will make you a deal  I will kick one   
## 3                                                                                                                I don t think that the creator of this thread cares what s going on here after   years   
## 4                                                                                                I am both annoyed and intrigued by xxFPs   As far as I can tell  I dislike all J types in my normal life 
## 5        I don t drink  but when I drank   Beer  Hardcore ciders and sweet brown ales   Liquor  VODKA chased with cran or water    my preferred drink  Wine  Anything dark  dry and sweet  There are so   
## 6                                                      glad you recognize my username    Yes  until you said INFJ  that type uses Fe Ti   The four types that use  Fi Te   Te Fi  are in my previous post 
##                                                                                                                                                                                                          31
## 1                                                                                                                                                 Banned for watching movies in the corner with the dunces 
## 2                                                                                                                       I m ANTP  Leaning toward E   I m easy for both ENTPs and INTPs to identify with    
## 3                                                                                                                                               Heh  I understand you    With these same given languages   
## 4    I m not of the mind that any enneatype MBTI combination is impossible because cognition     the things that motivate us  That said  we can clearly observe many types being more common than others   
## 5                                                                                                                                                                              Well that escalated quickly 
## 6 INFP  Going out with one now  We don t understand each other in some ways  though understanding is a lot better than most type matches   but we challenge each other and help each other grow  We have   
##                                                                                                                                                                                                        32
## 1                                                                                                                             Banned because Health class clearly taught you nothing about peer pressure 
## 2 I also imagine ENTP s interrogations would go a little bit like Jack s from    except more mechanical  Rigging up shock treatment equipment in an abandoned building out of an old car batty  jumper   
## 3                                                                                                                                                                               Yessss  Adventure Time  D
## 4                                                                                                                                                                                       Sx as hell       
## 5                                                                                                                                                                                                        
## 6                                                                                          Welcome  Now bring me some Pizza    Actually  that could happen to me after I m done with my English degree XD
##                                                                                                                                                                                                           33
## 1                                                                                                                                                                        Banned for a whole host of reasons 
## 2 It was a compliment    Trust me  I m just as psychopathic  D except I have emoticons  They re just weird ones  Like laughing when I get hurt or at people running themselves over with their lawn mower   
## 3  I get angry quite rarely  but when I do  it s safer for surrounding people to go somewhere else  It s impossible for me to hide or suppress anger  the only way to get rid of this feeling is to burst   
## 4 Very seriously toying with the idea of being      I can be pretty aggressive and controlling  but I have a massive  holier than thou  streak once you get to know me with any depth  like more than       
## 5                                                                                                                                                                                               tl dr fuuuuu
## 6     You need to think about the reasons for what you want and about how realistic each of your goals are  Maybe one is more of a fantasy and one is actually worthwhile  That s what I would do anyway    
##                                                                                                                                                                                                         34
## 1                                                                                                                                                                                                         
## 2                                                                                                                                                                                                         
## 3                                                                                                                                                     I ve never liked it  Anything fake is bad  actually 
## 4                                                                                                                                                              I d say it s a mostly emotional experience 
## 5                                                                                                               Those people who think they know everything are a great annoyance to those of us who do IA
## 6 What my previous post said was  you seem like a dominant Fi  Do you do all this Ne thing or this FiNe thing  Put into terms that the OP understands    The   letters are intended to be shorthand for   
##                                                                                                                                                                                                      35
## 1    Two baby deer on left and right munching on a beetle in the middle      Using their own blood  two cavemen diary today s latest happenings on their designated cave diary wall      I see it as   
## 2                                                                                                                        No  It s like a theme for where I live and that is why I know it by heart     
## 3                                                                                                                Hugs should be given only to chosen ones  Chosen  There are quite few of them  though 
## 4 Because I find in depth study of cognition more interesting  Included MBTI in my answer to illustrate how much I enjoyed socionics  Interpret the post as wholehearted agreement with what she was   
## 5                                                                                                                   Darth Alpha  I would never claim it to be healthy either  Just in my best interest 
## 6                                                       You seem like an obvious I  F  and P  INFP is the strongest possibility  Possibly ISFP  though  How do you brainstorm  Do you overthink things 
##                                                                                                                                                                                                         36
## 1                                                                                                                                           a pokemon world  an infj society  everyone becomes an optimist
## 2                                      and I usual don t leave until the thing ends  But in the mean time  In between times  You work your thing  I ll work mine  D   D I m the MBP  Pleasure to meet you 
## 3                                                                                                                                                                                                         
## 4 No real argument here    I know what I am  and what I am is an asshole that is  for a second baring his teeth at the people that seemingly have a lot to say but refuse to address me beyond a single   
## 5 On loyalty   I am loyal to the vision  I am loyal to those who share the vision  I am not into co dependency in terms of the vision cannot be accomplished without others involved  I stay on course    
## 6    Combining your anxiety and avoidance scores  you fall      into the secure quadrant   Previous research on attachment styles indicates that     secure people tend to have relatively enduring and   
##                                                                                                                                                                                                         37
## 1                                                                                                                                                                                                         
## 2                                                                                                                  Damn  need to trust my instincts more I would have been closer I was going to say INFP 
## 3                                                                                                                                                                            Yup  you re doing it right   
## 4 I would refer you to the OP  If you need a literal analysis  I m happy to provide it  That said  I m going to assume you re able to read and interpret symbolism  so I doubt you ll need that much help 
## 5                                                                                                                                                Your answer was worth more time to entertain than the OP 
## 6 I don t think you can simply reach into your mind anytime to tell if you love someone    Perhaps you have fantasized for a long time and expect a real relationship to be like that in some ways  But   
##                                                                                                                                                                                                          38
## 1                                                                                                                                                                                                          
## 2                                                                            EXFP  Leaning toward S with the way she responded    D My friends  even my gay and lesbian ones  always come to me for advice 
## 3                                                                                                                                                                                                          
## 4 And this was sort of my thought process  The initial post and how it connects the generally accepted view of the type   and what the type   is motivated by doesn t seem to be in need of explanation    
## 5               Hey  MsBossyPants are you down for a debate on Ayn Rand vs Marx  Maybe we should talk about our poor Fi  Oh I know  let s try to correlate testing ENTJ with being sociopathic    laughing 
## 6          I don t think its impossible to doublethink  only impossible to remain in that state  which could explain why oceania fell after the end    The hard atheists I do not disagree with  Anyway    
##                                                                                                                                                                                                         39
## 1                                                                                                                                                                                                         
## 2                                                       I bow to my entp masters ENTPs are so great  If it wasn t for ENTPs I wouldn t have been able to build what I m building  Duck Duck  Duck  Shotgun
## 3                                                                                                                                                                                                         
## 4                                                                                                                                                        Oh my     I am quite crushable  huh   Back atcha 
## 5       Hitler was no exception  this concept has  is and always will be a principle  tenet  and rule  Politics  ideology  religion  eating  shitting usual   And if it s not  then there is nothing to   
## 6 Cows are a religious subject  Hindu  XD   If the denial of a religion is a religion  then most or all of us here are ascientologists  for example  Most everyone would have  what  at least thousands   
##                                                                                                                                                                                                      40
## 1                                                                                                                                                                                                      
## 2                                                                                                                                                                     What  Me  I never do that        
## 3 Of course it s not very comfortable   But  Human race survived thankfully women s ability to give birth to other human beings  It worked for thousands of years  Why change it  Besides  there are   
## 4                                                                                                                                                        I was  but it s  am  I ll take what I can get 
## 5 Hitler thought he was doing great things  Stalin thought he was justified  These guys thought they were uncorrupt  They viewed any heretic to their dogmas as morally bankrupt  and so did many of   
## 6  By that definition anything could be defined as a religion by attaching the suffix  ism    and then the word religion loses its meaning  I would say that religion has both a precise and general   
##                                                                                                                                                                                                           41
## 1                                                                                                                                                                                                           
## 2                                   Because its hard to be sad about losing someone you like when you knew you were right and give yourself a big pat on the back because you re awesome and always correct 
## 3        That happens  And it occurs because most often people use results of extremely precise and elaborate online tests as a basis of determining one s type       Both visual and language arts  more   
## 4                                                                                                            I wanted to come up with something clever  but it s almost  am   I would give you a lot of sex 
## 5 Meh  There were plenty of evil people who did good things  and plenty of good people who got blood on their hands achieving and attaining higher goals  Bad situations that had good long term effects    
## 6  There are no practices required to be an atheist  All that is required is a disbelief in deities  Other than that  atheists can have widely different beliefs  It is too general a term to be called a   
##                                                                                                                                                                                                           42
## 1                                                                             Not all artists are artists because they draw  It s the idea that counts in forming something of your own    like a signature 
## 2      Oh  you don t have to tell me that most of them are stupid  I know this  That is why I play with them and it makes me laugh   D As I m going to take Neuropsychology and I have a few psychologist   
## 3                                                                                                                                                                                                           
## 4 So then why do you even bother asking if you ve already made up your mind that you are an extravert  intuitive and feeling  If you ve  already decided you are these things and have evidently done the   
## 5    You would have to ask the OP  He is asking ambiguous questions  I would go with whatever is more efficient effective vs what is perceived as good every time in the good vs evil dichotomy  It in my   
## 6          My guess is ENTP  though it is hard to say just from this   Have you studied up on cognitive functions  If not  learning how each works and identifying which ones you use would be very helpful 
##                                                                                                                                                                                                         43
## 1                                                                                  Welcome to the robot ranks  person who downed my self esteem cuz I m not an avid signature artist like herself   proud 
## 2                                                                                                                                D I m a Nightowl  I wake up between    pm and stay awake till         am 
## 3 I study graphic design now  which I really enjoy  What is interesting about this field  is that the ability to generate ideas and solve problems is much more important than possession of a specific   
## 4                                                                                                                                                        Wasn t sure I listened to sx music until now     
## 5  Good vs Bad     Good vs Evil One is an objective positive vs negative dichotomy  the other is a subjective interpretation of characteristics    NameUser  So to be evil may be a better solution and   
## 6   I believe it has gone  through too many human hands to be thought of wholly as the word of God   or to be followed unquestionably   Yes  most useful when thought of as  a text by man about God      
##                                                                                                                                                                                                         44
## 1                                                                                                                   Banned for taking all the room under my bed  Ya gotta learn to share with the roaches 
## 2  Personal opinion backed by theory would suggest that INTPs are the most socially difficult  While INTJs can be socially indifferent but they will also use social situations if the the need arises    
## 3                                                                                                                                                                               Alexxxandra     DeviantArt
## 4         INFP messaged me with a picture of herself before going to bed   Asked me to say goodnight to her   Asked me to say goodnight to her again   I did  I thought it was weird  secretly   I like   
## 5 I think they are for sure idiots  but I also think these people went out of their way to fuck their lives up  Did they expose themselves on the internet  Yes  Does this warrant or validate a reason   
## 6         Apparently  you need to pose as a gay guy to pick up women   But  seriously  Its       You have a world of media at your fingertips  In a poll that appears to be from eHarmony  though it is   
##                                                                                                                                                                                                         45
## 1                                                                                                                                                                                                         
## 2                                                                                           Personal stocks that I have on my desktop that I ve downloaded from random stock sites and stock photobuckets 
## 3                                                                                                                                                                                                         
## 4 Either way  you see my point  The actual rarity is skewed and makes a type seem rarer than it likely is in real contexts  I may have been the only one of my type in a class room in High School  but   
## 5  I really REEEEEEAAALLLY hate rigidly PC thumb sucking nanny bitches  They remind me of five year olds who are trying too hard to gain their parents approval by taddling  These are the same people    
## 6     We are playing a game called Mafia  We have to vote on who to kill for this round  who we think is part of the Mafia  Rob  names made up  says  kill Joe   I suggest killing Rob  Rob says  Don t   
##                                                                                                                                                                                                         46
## 1                                                                                                                               Banned for being too much of a thundering  grumbling kind of storm    yep 
## 2                                                                                                                                        I ll tell you when I open photoshop      Glad you like it static 
## 3                                                                                                                                                                                                         
## 4       WOW my math was off  I literally just said numbers  See how over glorified the type is   Even so  though  I saw around two hundred people  REALLY rough estimate  between both of my jobs  It s   
## 5 I think people need to get some skin  Even if these people are wrong or racist  That s just a waste of time  energy  and resources  These people end up being the focus for being petty and overboard   
## 6                                                                                                                                                       what you need to know as an INTJ fiction writer   
##                                                                                                                                                                                                      47
## 1                                                                                                                                             Ahh    old high school music I haven t heard in ages     
## 2                                                                                                                                                                                             D Thanks 
## 3                                                                                                                 I am always ready to discipline  to intimidate  to be precise  my sibling s offender 
## 4 Rarity in the context of the entire planet is somewhat silly  Even if we assume the greatest reports of our  rarity   we  INTJ  encompass    of the planet  which sounds rare when you don t think   
## 5                                                                                                                                                                                                      
## 6                              Bolded are ones I actually live with   Mother  ISFJ Father  ISTJ Sister  ISTP Half Sister  ESFJ  Grand mother  mother s side   ENFP Step brother ESFP Step father  ESFP 
##                                                                                                                                                                                                       48
## 1 I failed a public speaking class a few years ago and I ve sort of learned what I could do better were I to be in that position again  A big part of my failure was just overloading myself with too   
## 2                                                                                                                                                                                                       
## 3                      World domination  Shooting people in the head  Why   Oh  right  INTJs always must be characterised only with these words      I want to show so badly my reaction to this        
## 4 One could say that whatever the culmination of all of our actions are throughout our lives equal our potential   In this sense  everybody does  but as we all know  not everyone s potential is the   
## 5                                                                                                                                                                                                       
## 6                                                                                                       Very interesting  Explains why these two types often see each other as close minded or arrogant 
##                                                                                                                                                                                                           49
## 1                                                                                                                                        I like this person s mentality  He s a confirmed INTJ by the way   
## 2                                                                                                                                                                                                  Static   
## 3                                                                                                                                                                                                           
## 4  I would agree  however  those that profess to know their type not stating anything about their type s motivations strike me as either not wanting to touch on them or not being able to  If they don t   
## 5       I m not trying to be condescending when I tell you  all those things you have mentioned people saying and have written off as all I have been met with are legit arguments  They don t need to be   
## 6 There are as many INTJs as there needs to be  If everyone is a leader  who is going to follow  And who is going to take the jobs that no intuitive would want  There is a part in Brave New World where   
##                                                                                                                                                                                                           50
## 1                                                                                                                                                  Move to the Denver area and start a new life for myself  
## 2 Psychologist don t keep me around long enough to diagnosis me  I like to toy with them  What I have diagnosis myself with and had a few psychologist friends    a few other friends  tell me I have is    
## 3                                                                                                                                                                                                  ISTP     
## 4                                                                                                                                                                                                      Lol  
## 5                                      The brevity of my posts is because you don t take much to refute  Just because you aren t acknowledging what people are saying doesn t mean they are saying nothing  
## 6                                                                                                                                    Mm  probably INTP now that I have become more familiar with that type

finding important words based on TF_IDF creterion: TF-IDF: We wish to know the most important words used in the posts .For this we use Term Frequency -Inverse Document Frequency matrix .TF-IDF computes a weight which represents the importance of a term inside a document.It does this by comparing the frequency of usage inside an individual document as opposed to the entire data set (a collection of documents).

The importance increases proportionally to the number of times a word appears in the individual document itself–this is called Term Frequency. However, if multiple documents contain the same word many times then you run into a problem. That’s why TF-IDF also offsets this value by the frequency of the term in the entire document set, a value called Inverse Document Frequency.

all_type_sen <- melt(clean_type_sen,id= 'type')
all_type_sen$variable = NULL
colnames(all_type_sen)[2] = 'text'
head(all_type_sen,100)
##     type
## 1   INFJ
## 2   ENTP
## 3   INTP
## 4   INTJ
## 5   ENTJ
## 6   INTJ
## 7   INFJ
## 8   INTJ
## 9   INFJ
## 10  INTP
## 11  INFJ
## 12  ENFJ
## 13  INFJ
## 14  INTJ
## 15  INTP
## 16  INTP
## 17  INFJ
## 18  INFP
## 19  INFJ
## 20  INFP
## 21  INTP
## 22  INFJ
## 23  ENTJ
## 24  INFP
## 25  ENTJ
## 26  INFP
## 27  ENFP
## 28  ISFP
## 29  INFP
## 30  INFJ
## 31  INFP
## 32  INFJ
## 33  INTP
## 34  INFJ
## 35  ENFJ
## 36  INFJ
## 37  INTJ
## 38  INFP
## 39  ENFP
## 40  ENTJ
## 41  ISTP
## 42  INFJ
## 43  INTP
## 44  INFP
## 45  INTJ
## 46  INTP
## 47  ENTJ
## 48  INFP
## 49  ISFJ
## 50  INTJ
## 51  INTP
## 52  INFP
## 53  ISFJ
## 54  INTP
## 55  INFP
## 56  INFP
## 57  INFP
## 58  ENFJ
## 59  INTP
## 60  INTJ
## 61  INFJ
## 62  INTP
## 63  INFP
## 64  INFP
## 65  ENTP
## 66  INTP
## 67  ISFP
## 68  ENFJ
## 69  INFJ
## 70  ENFJ
## 71  INFJ
## 72  INFP
## 73  ENFP
## 74  ISTP
## 75  INFJ
## 76  INTP
## 77  INTJ
## 78  INTJ
## 79  INTJ
## 80  INFP
## 81  INFP
## 82  INFJ
## 83  ENTP
## 84  ENTJ
## 85  INFP
## 86  INTP
## 87  INFP
## 88  ISFJ
## 89  ISTJ
## 90  INTP
## 91  ENTP
## 92  INTP
## 93  ISFP
## 94  ENFJ
## 95  INFJ
## 96  INFP
## 97  INFJ
## 98  INTJ
## 99  INFJ
## 100 ENFP
##                                                                                                                                                                                                            text
## 1                                                                                                                                                                                                              
## 2                                                                                                                                                      I m finding the lack of me in these posts very alarming 
## 3                                                                                                                                                                                           Good one           
## 4                  Dear INTP    I enjoyed our conversation the other day   Esoteric gabbing about the nature of the universe and the idea that every rule and social code being arbitrary constructs created   
## 5                                                                                                                                                                                                 You re fired 
## 6                                                                                                                                                                                                              
## 7               No  I can t draw on my own nails  haha   Those were done by professionals on my nails  And yes  those are all gel   You mean those you posted were done by yourself on your own nails  Awesome 
## 8                           I tend to build up a collection of things on my desktop that i use frequently and then move them into a folder called   Everything  from there it get sorted into type and sub type
## 9          I m not sure  that s a good question  The distinction between the two is so dependant on perception  To quote Robb Flynn    The hate you feel is nothing more  than love you feel to win this war   
## 10                                                                                                                                                                                                             
## 11         One time my parents were fighting over my dad s affair and my dad pushed my mom  The fall broke her finger   She s pointed a gun at him and made him get on his knees and beg for his life  She s   
## 12                                                                                                                                                                                                             
## 13                                                                                                                                                                                         Joe santagato   ENTP
## 14    Fair enough  if that s how you want to look at it  Like I stated before  they were incredibly naive in their comments    However  they think those are things that would help us because those are the   
## 15                                                                                                                                                                                         Basically this      
## 16                                                                                                                                                 Your comment screams INTJ  bro  Especially the useless part 
## 17                                                         some of these both excite and calm me   BUTTS  bodies  brains  community gardens  camping  camping with dogs  hiking with dogs  chillin with animals
## 18          I think we do agree  I personally don t consider myself Alpha  Beta  or Foxtrot  lol at my own joke   People are people  We both agree that having emotions isn t the same as being weak  whiny    
## 19      I fully believe in the power of being a protector  to give a voice to the voiceless  So in that spirit I present this film  and hope it it recieved in the spirit of compassion   Om Mani Padme Hum    
## 20                                       That s normal  it happens also to me  If I am in high mood  I can act like a      Depressed  like a      Satisfied and relaxed       But the real type of mine is     
## 21       Steve Job s was recognized for his striving for efficiency and practicality  His genius is in his systemization of inventions  less so than in invention  This is where claims of Se and Te come from 
## 22      It is very annoying to be misinterpreted  Especially with regards to your core  to your intentions and desires  Like when people keep saying that you re in love with somebody for whom you only had   
## 23                                                                                                                           Now I m interested  But too lazy to go research it  because it s time consuming   
## 24                                                                                                                                                                               urh sorry uh  couldn t resist 
## 25       Still going strong at just over the two year mark  I have made noticeable changes and do not plan on slowing  I have attached my   year progress picture  but with my face cropped out  you know to   
## 26                                                                                                                                   Personally  I was thinking this would be more of an SJ type job in a ways 
## 27      He doesn t want to go on the trip without me  so me staying behind wouldn t be an option for him  I think he really does believe that I m the one being unreasonable  He still continues to say that   
## 28                                                                                                                                                                                   They paint without numbers
## 29                                                             Basically  my main questions are   What do you believe in   What are the values that matter the most to you     Sorry if I tend to be confusing 
## 30    I think that that can absolutely be true of infjs  and we shamefully have much potential in that department  Not gonna lie  I am guilty of some unwarranted door slams  and maybe it may seem cruel at   
## 31             Is it possible to stop caring about someone entirely   Well I believe it s possible to stop caring about someone entirely   If they never cross your mind anymore  then you d never bother to   
## 32                                                                                                                                   it could be pyroluria   you know   it is an ongoing tension inside of you 
## 33      I m seriously considering marriage to my longtime ENFP girlfriend  But do you think she ll be able to give me a little more space when we are settled down in marriage  My two biggest problems with   
## 34                                                         Sometimes I wonder that too   the reason being that INFJ s seem so absractly deep that even being one myself I don t understand them all the time  D
## 35                                                                                                                                                                                                             
## 36                                                                                                                                                                                                             
## 37      Poker face for sure  accompanied by some sarcasm probably  But inside I m running a pretty vivid list of pros and cons starting with asking myself  do I like them back   I probably know the answer   
## 38                                                                                                                                                                                                             
## 39         Hey ENFPs  I ve posted this thread on the philosophy board too  but I am really curious to reading responses from ENFPs in particular   I ve realized that I am quite prone to the following        
## 40          Hello   I am working on a presentation by type   Part of each presentation is feedback from a range of people of the type being reviewed   I would greatly appreciate it if you could take a few   
## 41                                                                        I got       From what I ve read about the Enneagram I m a      though   I read somewhere that a lot of   s mistype themselves as   s 
## 42            Trying not to feel totally worthless     Why do I have to be so sensitive ugh stupid brain      Maybe you never actually gave a fuck   You don t know the damage you ve done   that I ve done    
## 43    Painting the world with the colors of my soul  Interpret it as you like   helping others by volunteering  teaching  giving everything you have   Personal growth   learning as much about the universe   
## 44    I m Type   and people in my family  who aren t gut types  sometimes complain that I  don t think   I do feel like I don t really  think  about certain actions   I just do them  almost automatically    
## 45                                                                                                                                                                                                             
## 46       Eh    hate the music  the consumerism  a lot of it  The dinners are usually stilted and uncomfortable  the gift giving disappointing  overall  not my thing  My friends and I usually go out and do   
## 47        No  If you neglect them  your finances will always be burning on the back of every decision you make  will start to influence your friendships and warp your perceptions of other people and their   
## 48              Bruce Wayne  INFJ Batman persona  ESFP  moral edition  Alfred  ISFJ Rachel  ESFJ Commissioner Gordon  INTP Ra s Al Ghul  ESTJ  messed up edition  The Joker  ENTP  messed up edition  Harvey   
## 49       I love feeling affectionate for the one I love and care for  I care about her very deeply  I want to protect her  make her happy  and always be by her side   I feel that romantic love is probably   
## 50                                                                                                                                         Why tell  when I can show    ratchan s PSN Profile   PSNProfiles com
## 51               Would be interested in a detailed answer to this question also  Would love to answer properly but I agree and i my view is yes  because I procrastinate every day in many areas of my life    
## 52      Okay  I meant to create this thread here but I accidentally created it somewhere else  so I ll just copy and paste it here    Hello everyone  it s been a long time since I ve visited this forum  I   
## 53      I m currently rooting around in the forum  looking for a place to rant  I think this thread is as good as any    I have a friend who asks me to go with her to a bunch of events and stuff that I do   
## 54                                                 once you realize you are an INTP  you either will become more INTPish  or instead try to evolve and be more open to emotions  without logical explanations  
## 55                                                                     I love reading  and I wish I wasn t allergic to dust  so I could read all those beautiful  old  dusty books  I love seeing people smile 
## 56                                                                                                                                                                                                   ideal you 
## 57                                                                                                                                                                                Pure sass when it strikes me 
## 58         That sounds like a beautiful relationship already  But don t push too fast as it seems she needs to be appreciated as a friend  But at the end of the day you can only feel what happens when the   
## 59                                                                                                                       I have many social screw ups  None of them funny though  mostly mentally traumatizing 
## 60                                                                                                                                    I feel some way about people that can t solve the problem if that counts 
## 61                                                                                                                                                                    Me  INFJ Mom  ISTJ Dad  ENFJ Sister  ISTJ
## 62               You re taking life too seriously  bro  Chill   Also  just be comfortable with yourself and don t hate on others    Hate is not healthy for you  Even more so when you think too much about it 
## 63            Well I have not attended graduate school yet but I am in the same boat as you   I plan on applying for graduate school in counseling this fall and I have been attempting to do some research    
## 64     That s an opinion  not a fact   That being said  I believe in the inherent right of everyone to be as big of an asshole as they want as long as they don t infringe on the rights of others to do the   
## 65        I believed in God all my life up until about a year ago  My mother was a very strong believer in God and encouraged me and my brothers to be the same way  She didn t force it down our throats or   
## 66     No offense to any ESTJs that may read this  but the few that I ve talked to are obnoxious  loud  lie about shit to try to look cool  and usually talk out of their asses about things they can t back   
## 67                                                          True  sadly not many have felt like participating in it unsure   it could be so helpful if more ISFP s felt like sharing their point of view  wink 
## 68    I ve always thought of Tony Stark as more of an ENTJ     and it sort of matters to me his type because I ve been wondering the type of one of my teachers as a reference point and he s very much like   
## 69    I would strongly recommend not taking shortcuts   I feel like whenever you re looking for something too specific you end up missing out on interesting opportunities   That ESTP who s the life of the   
## 70                                                                                                                                                         ABILITY TO TRANSFORM   Form of    a bucket of water 
## 71   than you may be an ambivert  somewhere in the middle  I read in a book called the Introvert Advantage by Martin Olsen Laney that people who can gain energy by doing both could be an ambivert  You may   
## 72                                                                                                                                                     Last real relationship I ve been in was over a year ago 
## 73                                                                                                                                                                      My brothers and I  I m on the far right
## 74                                                                                                                                                                                 I m only a mystery to myself
## 75       Yeah i m an a hole too depending on who you are and what you consider one to be   Nothing wrong with that    just be you  who cares what your supposed to be    who knows maybe your brother is the   
## 76                                                                                                                                       Add me to the empathetic club  I can also be very expressive at times 
## 77          Friend  So  you haven t been to the new office yet  Me  No   I was planning to go to the grand opening but        something happened    Friend  You really need to work on your social excuses     
## 78                                                                                                                                                                You clearly don t want to move there   Don t 
## 79     I suck at keeping in touch with people  No matter how hard I try  or how much I like someone  I only have the social energy to even attempt to stay in touch with about two or three people at a time   
## 80                       I ve heard all my life that you either get Algebra or Geometry  I can t say why that is  Apologies  I was good with Calculus  It was Trig and Geometry  gaaaah  Beat them with sticks 
## 81                                                                                                                                                                                                       Cosmo 
## 82       Thanks  JayDubs  Miss Bingley LittleDreamer  Your advices are important   D   And how you deal with a familiar that wants to force you to go to uni  I just can t stand my grandma s cold looks and   
## 83   Good stuff   I used cpa excel to study and basically tried to learn a little bit about every sub topic   you can t get too bogged down in the details   if you catch yourself getting bogged down  look   
## 84                                                                                                                                                                                                         Bump
## 85        i regret watching the finals for this tourney   i knew i should of just read about the result after the fact  team i was rooting for totally outclassed    winners played out of their minds    so   
## 86        I m bouncing in and out of this thread as my temper allows  I will admit  I m using my reserves of temper to respond this   The italicized is unreasonable  That s not going to argued against  On   
## 87                                                                                                                                                              potentially the most dangerous man in the world
## 88            i beat that by seeking out a housemate that worked away months at a time  and when he was home  he visited his mates after they finished work  so i was alone     of the time  D     oh i dont   
## 89                                                                                   Newton s Universal Gravity Law  I mean seriously  where would we be if nothing followed that law  Dust particles in space 
## 90      I m thinking that you are probably INTP  A lot of your answers are nearly identical to what mine would be  and yes  I know  this is an unscientific way to confirm  but I don t have time to analyze   
## 91   I know an ENTJ and it s everything I wanted to be  So full of purpose and the drive to execute in the best quality  but intimidating  Some INTJs I met are pretty cool  you can leave them be and still   
## 92       Software development   My job is terrible for me because most of it is support related  I need to be creating something interesting in order to be fulfilled by my work and I can so rarely do that   
## 93           Make all the money that goes to unnecessary shit like war and capitalism be re directed into the health care system     Change food  people should buy local  With all the energy spent to make   
## 94                                                                                                                                                                                              It burns   Haha
## 95      I hate not being able to afford any real help on my own  I tried using a therapy app and got a response telling me to drink bleach and another saying that I should send pictures of self harm scars   
## 96    In Udaipur  Rajasthan  where I lived for a few years  squirrels roamed wild over the houses and were barely tolerated by the people  I began feeding the ones in my yard   corn  bread  nuts  but then   
## 97      Amelie   though I m sure someone has mentioned this already  Shutter Island   It s the only movie I can think of right now but it s full of metaphors and has an unpredictable and twisted plot that   
## 98                                                                                                                                                                                                             
## 99                                                                 This   Also flashbacks to times you ve been criticized by others  especially if you feel it was undeserved criticism you were misunderstood 
## 100                                                                                                          Learning to say no  the right way  is the greatest talent you have yet to cultivate   Good luck
temp=subset(all_type_sen,!(is.na(all_type_sen$text)))
temp=temp %>% unnest_tokens(word,text)%>% count(type,word,sort=TRUE) %>% ungroup()
total_words=temp %>% group_by(type) %>% summarise(count=n())
temp=left_join(temp,total_words)
## Joining, by = "type"
head(temp,10)
## # A tibble: 10 x 4
##    type  word       n count
##    <fct> <chr>  <int> <int>
##  1 INFP  i     144709 45329
##  2 INFJ  i     113796 40163
##  3 INTP  i      88733 39157
##  4 INTJ  i      71402 35170
##  5 INFP  to     64908 45329
##  6 INFP  the    63388 45329
##  7 INFJ  to     54413 40163
##  8 INFP  and    54038 45329
##  9 INFP  a      53425 45329
## 10 INFJ  the    53374 40163

Here n is the number of times the word is used in the whole posts and count is the total number of terms in the posts of the respective type . We look at the] n/total for each type . This is exactly what term frequency is. and means how much importance that word in document could be . by using bind_tf_idf function from tidytext package we calculate TF :

temp=temp %>% filter(!(is.na(type))) %>% bind_tf_idf(word,type,n)
temp1=temp %>% filter(idf<2)%>% select(-count) %>% arrange(desc(tf_idf))
temp1
## # A tibble: 259,635 x 6
##    type  word            n        tf   idf   tf_idf
##    <fct> <chr>       <int>     <dbl> <dbl>    <dbl>
##  1 ESFP  digger         20 0.000383  1.16  0.000446
##  2 ESTJ  posh           27 0.000531  0.470 0.000249
##  3 ESTJ  hav             8 0.000157  1.39  0.000218
##  4 ESTJ  cleo            5 0.0000983 1.67  0.000165
##  5 ESTJ  uuu             6 0.000118  1.39  0.000163
##  6 ESTJ  thanx          10 0.000197  0.693 0.000136
##  7 ESTJ  auction         4 0.0000786 1.67  0.000132
##  8 ESFP  personnally     4 0.0000767 1.67  0.000128
##  9 ISTJ  rave           87 0.000331  0.375 0.000124
## 10 ISFJ  skellie        16 0.0000733 1.67  0.000123
## # ... with 259,625 more rows
temp1 %>% group_by(type) %>% top_n(20) %>% ungroup() -> temp1
## Selecting by tf_idf
for (each in unique(temp1$type)){
  temp1 %>% filter(type==each) %>% 
  ggplot(aes(word,tf_idf))+geom_col(show.legend=FALSE)+labs(x="",y="tf-idf",title="Top 20 Words")+facet_wrap(~type,ncol=1)+coord_flip() -> p
  print(p)
}

World cloud of important Words for each type

for (each in unique(temp1$type)){
  par(mfrow=c(1.2,1.2))
  temp1 %>% filter(type==each) %>% with(wordcloud(word,tf_idf, max.words =100,min.freq=3,scale=c(4,.5),
           random.order = FALSE,rot.per=.5,colors=palette()))+ text(x=0.5,y=0.9,each)
}

## Warning in wordcloud(word, tf_idf, max.words = 100, min.freq = 3, scale =
## c(4, : categorising could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, tf_idf, max.words = 100, min.freq = 3, scale =
## c(4, : depletion could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, tf_idf, max.words = 100, min.freq = 3, scale =
## c(4, : dextroamphetamine could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, tf_idf, max.words = 100, min.freq = 3, scale =
## c(4, : grime could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, tf_idf, max.words = 100, min.freq = 3, scale =
## c(4, : himalayan could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, tf_idf, max.words = 100, min.freq = 3, scale =
## c(4, : sallyjones could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, tf_idf, max.words = 100, min.freq = 3, scale =
## c(4, : speedometer could not be fit on page. It will not be plotted.

## Warning in wordcloud(word, tf_idf, max.words = 100, min.freq = 3, scale =
## c(4, : ferroequinologist could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, tf_idf, max.words = 100, min.freq = 3, scale =
## c(4, : wums could not be fit on page. It will not be plotted.

## Warning in wordcloud(word, tf_idf, max.words = 100, min.freq = 3, scale =
## c(4, : computers could not be fit on page. It will not be plotted.

## Warning in wordcloud(word, tf_idf, max.words = 100, min.freq = 3, scale =
## c(4, : wandering could not be fit on page. It will not be plotted.

only one words doesnt show a lot of intresting words . so I use bigrams here : Using TF-IDF to know Most Important Bigrams:

temp=subset(all_type_sen,!(is.na(all_type_sen$text)))
temp=temp %>% select(type,text) %>% unnest_tokens(bigram,text,token="ngrams",n=2)
head(temp,10)
##    type                 bigram
## 1  ENFJ            that sounds
## 2  ENFJ            sounds like
## 3  ENFJ                 like a
## 4  ENFJ            a beautiful
## 5  ENFJ beautiful relationship
## 6  ENFJ   relationship already
## 7  ENFJ            already but
## 8  ENFJ                but don
## 9  ENFJ                  don t
## 10 ENFJ                 t push
tempseperated=temp %>% separate(bigram,c("word1","word2"),sep=" ")
tempfiltered=tempseperated %>% filter(!(word1 %in% stop_words$word)) %>% filter(!(word2 %in% stop_words$word))
temp=tempfiltered %>% unite(bigramwords,word1,word2,sep=" ") %>% group_by(bigramwords,type) %>% tally()%>% ungroup() %>% arrange(desc(n))  %>% mutate(bigramwords=factor(bigramwords,levels=rev(unique(bigramwords))))
temp =temp %>% bind_tf_idf(bigramwords,type,n)
temp1=temp %>% select(-n) %>% arrange(desc(tf_idf)) %>% mutate(bigramwords=factor(bigramwords,levels=rev(unique(bigramwords))))
for (each in unique(temp1$type)){
  temp %>% filter(type==each) %>% top_n(10) %>%  ungroup() %>%
  ggplot(aes(bigramwords,tf_idf))+geom_col(show.legend=FALSE)+labs(x="",y="tf-idf",title="Top 20 Words")+facet_wrap(~type,ncol=1)+coord_flip() -> p
  print(p)
}
## Selecting by tf_idf
## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

## Selecting by tf_idf

sentiment analysis I find positive and negetive sentimntal words count of each type(by bing sentiment) and by calculating diffrention of positive to negetive divided by whole words can find how sentiment they are . (posetive-negetive)/ (posetive+negtive)

tokens=subset(all_type_sen,!(is.na(all_type_sen$text)))
tokens %>% unnest_tokens(word,text) -> tokens
tokens  %>% group_by(type)%>%
  inner_join(get_sentiments("bing")) %>% # pull out only sentiment words
  count(sentiment) %>% # count the # of positive & negative words
  spread(sentiment, n, fill = 0) %>% # made data wide rather than narrow
  mutate(sentiment = (positive - negative)/(positive + negative)) -> type_sent# # of positive words - # of negative owrds 
## Joining, by = "word"
type_sent %>% arrange(sentiment) %>% ggplot() + geom_bar(aes(x=reorder(type,-sentiment),y=sentiment,fill=type),stat='identity')+ theme(axis.text.x = element_text(angle = 90, hjust = 1))

it shows that Extroveted people are using more posetive words than introverts . it can easily be seen that sensing people using posetive words more than intuitive people . we have this for feeling people form thinking people too.

sentiment analysis by NRC dataset

tokens  %>% group_by(type)%>%
  inner_join(get_sentiments("nrc")) %>% # pull out only sentiment words
  count(sentiment) %>% # count the # of positive & negative words
  spread(sentiment, n, fill = 0) -> nrc_tokens # made data wide rather than narrow 
## Joining, by = "word"

Mood Ring for all types

library(chorddiag)
row_names <- nrc_tokens$type
sent_count <- dim(nrc_tokens)[2]
nrc_tokens <- cbind(nrc_tokens, Total = rowSums(nrc_tokens[,2:sent_count]))
nrc_tokens[,2:sent_count] <- nrc_tokens[,2:sent_count] / nrc_tokens$Total
head(nrc_tokens)
## # A tibble: 6 x 12
## # Groups:   type [6]
##   type   anger anticipation disgust   fear    joy negative positive
##   <fct>  <dbl>        <dbl>   <dbl>  <dbl>  <dbl>    <dbl>    <dbl>
## 1 ENFJ  0.0546        0.103  0.0372 0.0619 0.114     0.115    0.251
## 2 ENFP  0.0555        0.104  0.0403 0.0625 0.114     0.118    0.247
## 3 ENTJ  0.0598        0.101  0.0432 0.0659 0.0933    0.126    0.250
## 4 ENTP  0.0598        0.101  0.0437 0.0660 0.0958    0.131    0.245
## 5 ESFJ  0.0525        0.108  0.0381 0.0623 0.110     0.111    0.258
## 6 ESFP  0.0576        0.102  0.0392 0.0599 0.102     0.126    0.251
## # ... with 4 more variables: sadness <dbl>, surprise <dbl>, trust <dbl>,
## #   Total <dbl>
stu = as.matrix(nrc_tokens[,2:sent_count])
row.names(stu) = row_names
chorddiag(stu, type = "bipartite", showTicks = F, groupnameFontsize = 14, groupnamePadding = 10, margin = 90)
## Warning in RColorBrewer::brewer.pal(g1, palette2): n too large, allowed maximum for palette Greys is 9
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(g2, palette): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors

as you can see there are some intution about group that we cant get by this chart . but for further analysis we have to find this chart for each diffrent type . like Extrovert to introvert and…

for each two column for below lines are showing ESTJ: extraversion (E), sensing (S), thinking (T), judgment (J) INFP: introversion (I), intuition (N), feeling (F), perception (P)

nrc_tokens %>% mutate(introvert = ifelse(str_detect(type,'I'),'INTROVERT','EXTROVERTS'))%>% mutate(thinking = ifelse(str_detect(type,'T'),"Thinking",'Feeling')) %>% 
   mutate(Sensing = ifelse(str_detect(type,'S'),"Sensing",'intuition')) %>% 
   mutate(Judgment = ifelse(str_detect(type,'J'),"Judgment",'perception')) -> nrc_tokens

EXTROVERTS,INTROVERT

nrc_tokens %>% ungroup() -> nrc_tokens
temp =split(nrc_tokens,f=nrc_tokens$introvert)
r1 <- temp$EXTROVERTS %>%  select(c(2:sent_count)) %>% colSums()
r2 <- temp$INTROVERT %>%  select(c(2:sent_count)) %>% colSums()
stu <- rbind(INTROVERT=r1,EXTROVERTS=r2)
row.names(stu)
## [1] "INTROVERT"  "EXTROVERTS"
chorddiag(stu, type = "bipartite", showTicks = F, groupnameFontsize = 14, groupnamePadding = 10, margin = 90)
## Warning in RColorBrewer::brewer.pal(g1, palette2): minimal value for n is 3, returning requested palette with 3 different levels
## Warning in RColorBrewer::brewer.pal(g2, palette): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors

as it can be seen introverts and extroverts are using same percent of diffrent sentimental words in their posts.

Thinking,Feeling

temp =split(nrc_tokens,f=nrc_tokens$thinking)
r1 <- temp$Thinking %>%  select(c(2:sent_count)) %>% colSums()
r2 <- temp$Feeling %>%  select(c(2:sent_count)) %>% colSums()
stu <- rbind(Thinking=r1,Feeling=r2)
row.names(stu)
## [1] "Thinking" "Feeling"
chorddiag(stu, type = "bipartite", showTicks = F, groupnameFontsize = 14, groupnamePadding = 10, margin = 90)
## Warning in RColorBrewer::brewer.pal(g1, palette2): minimal value for n is 3, returning requested palette with 3 different levels
## Warning in RColorBrewer::brewer.pal(g2, palette): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors

it can be seen that thinking people are using more negetive words more than feeling people . for joy category of words it is use more by feeling people .

Sensing,intuition

temp =split(nrc_tokens,f=nrc_tokens$Sensing)
r1 <- temp$Sensing %>%  select(c(2:sent_count)) %>% colSums()
r2 <- temp$intuition %>%  select(c(2:sent_count)) %>% colSums()
stu <- rbind(Sensing=r1,intuition=r2)
row.names(stu)
## [1] "Sensing"   "intuition"
chorddiag(stu, type = "bipartite", showTicks = F, groupnameFontsize = 14, groupnamePadding = 10, margin = 90)
## Warning in RColorBrewer::brewer.pal(g1, palette2): minimal value for n is 3, returning requested palette with 3 different levels
## Warning in RColorBrewer::brewer.pal(g2, palette): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors

Judgment,perception

temp =split(nrc_tokens,f=nrc_tokens$Judgment)
r1 <- temp$Judgment %>%  select(c(2:sent_count)) %>% colSums()
r2 <- temp$perception %>%  select(c(2:sent_count)) %>% colSums()
stu <- rbind(Judgment=r1,perception=r2)
row.names(stu)
## [1] "Judgment"   "perception"
chorddiag(stu, type = "bipartite", showTicks = F, groupnameFontsize = 14, groupnamePadding = 10, margin = 90)
## Warning in RColorBrewer::brewer.pal(g1, palette2): minimal value for n is 3, returning requested palette with 3 different levels
## Warning in RColorBrewer::brewer.pal(g2, palette): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors

Overal Shape of each types Post POST LENGTH OF EACH CATEGORY

all_type_sen %>% mutate(text_size = str_length(text)) %>% group_by(type) %>% summarise(mean_post_size= mean(text_size,na.rm=T)) %>%  arrange(mean_post_size) %>% ggplot() + geom_bar(aes(x=reorder(type,-mean_post_size),y=mean_post_size,fill=type),stat='identity')+ theme(axis.text.x = element_text(angle = 90, hjust = 1))

as it can be seeb intuition people tend to have longer post size than Sensing people. this can be shown easily by seprating intuition and Sensing like below :

all_type_sen %>% 
mutate(introvert = ifelse(str_detect(type,'I'),'INTROVERT','EXTROVERTS'))%>% mutate(thinking = ifelse(str_detect(type,'T'),"Thinking",'Feeling')) %>% 
   mutate(Sensing = ifelse(str_detect(type,'S'),"Sensing",'intuition')) %>% 
   mutate(Judgment = ifelse(str_detect(type,'J'),"Judgment",'perception')) ->all_type_sen
all_type_sen %>% mutate(text_size = str_length(text)) %>% group_by(Sensing) %>% summarise(mean_post_size= mean(text_size,na.rm=T)) %>%  arrange(mean_post_size) %>% ggplot() + geom_bar(aes(x=reorder(Sensing,-mean_post_size),y=mean_post_size,fill=Sensing),stat='identity')+ theme(axis.text.x = element_text(angle = 90, hjust = 1))

clean_type_sen <- NULL
#' Count frequency of a word or punctuation mark in a text
#'
#' Matches a vector of target words/punctuation marks to a larger vector 
#' of words/punctuation marks and counts how many times that particular word or 
#' punctuation marks occurs in the larger string. Returns a data table with the 
#' matched words or punctuation marks with their number the occurrances 
#' in the larger string.
#'
#' @param characters Large vector of words/punctuation marks to be matched with 
#'        a smaller list of desired words/characters.
#' @param char.list Vector of target words/punctuation marks to be matched with the larger
#'        vector of words/characters
#' @param punctuation Boolean that determines whether to convert
#'        punctuation marks into words in final output table
#' @note the accepted punctuation marks are commas, periods, semicolons, question marks
#'        exclamation points, quotation marks (forward and backward), ellipses and em-dashes.
#' @note to match quotation marks, use Unicode characters for right (u201D) and left (u201C) 
#'       quotation marks.
#' @export
#' @examples
#' char <- extract_token(gardenParty)
#' charfreq(char, c("she", "he", "them"), punctuation = FALSE)
#' 
#' char <- extract_punct(gardenParty)
#' charfreq(char, c(".", "...", "?"), punctuation = TRUE)

#' Get frequency of words per line
#'
#' Returns a data table returning the number of times a series of desired
#' words appears in a given line of text and the index number of that line.
#'
#' @param text Any text or document as a character vector
#' @param freqwords Vector of target words 
#'        to be matched with the text/document of interest
#' @importFrom dplyr mutate
#' @importFrom tidyr spread
#' @export
#' @examples
#' freq_word_line(text = gardenParty, freqwords = c("she", "they", "he"))

freq_word_line <- function(text, freqwords){
  line_index <- c()
  frequency <- NA
  for(i in 1:length(text)){
    words <- extract_token(text[i])
    WordsFreq <- charfreq(words, freqwords)
    line_index <- c(line_index, paste(i))
    WordsFreq <- tidyr::spread(WordsFreq, character, freq)
    if(i == 1){
      frequency <- WordsFreq
    }
    else{
      frequency <- rbind(frequency, WordsFreq)
    }
  }
  line_index <- as.numeric(line_index)
  output <- cbind(line_index, frequency)
  return(output)
}

#' Get frequency of punctuation marks per line
#'
#' Returns a data table returning the number of times a series of 
#' desired punctuation marks appear in a given line and the index 
#' number of that line.
#'
#' @param text Vector of strings representing lines of a text
#' @param punctlist Vector of target punctuation marks to be matched 
#'        with the text/document of interest
#' @importFrom dplyr mutate
#' @importFrom tidyr spread
#' @export
#' @examples
#' freq_punct_line(text = gardenParty, punctlist = c(".", "?", "..."))

freq_punct_line <- function(text, punctlist){
  line_index <- c()
  frequency <- NA
  for(i in 1:length(text)){
    words <- extract_punct(text[i])
    WordsFreq <- charfreq(words, punctlist, punctuation = TRUE)
    line_index <- c(line_index, paste(i))
    WordsFreq <- tidyr::spread(WordsFreq, character, freq)
    if(i == 1){
      frequency <- WordsFreq
    }
    else{
      frequency <- rbind(frequency, WordsFreq)
    }
  }
  line_index <- as.numeric(line_index)
  output <- cbind(line_index, frequency)
  return(output)
}

**frequency of punctuation for each type I use punctuation frequency as I think maybe sensing people using more punctuation than other group .

charfreq <- function(characters, char.list, punctuation = FALSE){
  freq <- c()
  char.list[which(char.list=="?")] <- "\\?"
  char.list[which(char.list==".")] <- "~"
  if(punctuation == FALSE){
    char.list <- paste("^", char.list, sep = "")
  }
  else{
    characters[which(characters == ".")] <- "~"
  }
  for(i in 1:length(char.list)){
    x <- length(grep(char.list[i], characters))
    freq <- c(freq, x)
    if(punctuation == TRUE){
      if (char.list[i] == ","){
        char.list[i] <- "comma"
      }
      if (char.list[i] == "\u2014"){
        char.list[i] <- "em_dash"
      }
      if (char.list[i] == "~"){
        char.list[i] <- "period"
      }
      if (char.list[i] == "\\?"){
        char.list[i] <- "question_mark"
      }
      if (char.list[i] == "!"){
        char.list[i] <- "exclaim_point"
      }
      if (char.list[i] == "..."){
        char.list[i] <- "ellipsis"
      }
      if (char.list[i] == ";"){
        char.list[i] <- "semicolon"
      }
      if (char.list[i] == "\u201C"){
        char.list[i] <- "left_quote"
      } 
      if (char.list[i] == "\u201D"){
        char.list[i] <- "right_quote"
      }
    }
  }
  char.list[which(char.list=="~")] <- "\\."
  if(punctuation == FALSE){
    char.list = substring(char.list, 2)
  }
  output <- data.frame(char.list, freq)
  colnames(output) <- c("character", "freq")
  return(output)
}




all_type_sen <- melt(type_sen,id= 'type')
## Warning: attributes are not identical across measure variables; they will
## be dropped
all_type_sen$variable = NULL
colnames(all_type_sen)[2] = 'text'
head(all_type_sen,100)
##     type
## 1   INFJ
## 2   ENTP
## 3   INTP
## 4   INTJ
## 5   ENTJ
## 6   INTJ
## 7   INFJ
## 8   INTJ
## 9   INFJ
## 10  INTP
## 11  INFJ
## 12  ENFJ
## 13  INFJ
## 14  INTJ
## 15  INTP
## 16  INTP
## 17  INFJ
## 18  INFP
## 19  INFJ
## 20  INFP
## 21  INTP
## 22  INFJ
## 23  ENTJ
## 24  INFP
## 25  ENTJ
## 26  INFP
## 27  ENFP
## 28  ISFP
## 29  INFP
## 30  INFJ
## 31  INFP
## 32  INFJ
## 33  INTP
## 34  INFJ
## 35  ENFJ
## 36  INFJ
## 37  INTJ
## 38  INFP
## 39  ENFP
## 40  ENTJ
## 41  ISTP
## 42  INFJ
## 43  INTP
## 44  INFP
## 45  INTJ
## 46  INTP
## 47  ENTJ
## 48  INFP
## 49  ISFJ
## 50  INTJ
## 51  INTP
## 52  INFP
## 53  ISFJ
## 54  INTP
## 55  INFP
## 56  INFP
## 57  INFP
## 58  ENFJ
## 59  INTP
## 60  INTJ
## 61  INFJ
## 62  INTP
## 63  INFP
## 64  INFP
## 65  ENTP
## 66  INTP
## 67  ISFP
## 68  ENFJ
## 69  INFJ
## 70  ENFJ
## 71  INFJ
## 72  INFP
## 73  ENFP
## 74  ISTP
## 75  INFJ
## 76  INTP
## 77  INTJ
## 78  INTJ
## 79  INTJ
## 80  INFP
## 81  INFP
## 82  INFJ
## 83  ENTP
## 84  ENTJ
## 85  INFP
## 86  INTP
## 87  INFP
## 88  ISFJ
## 89  ISTJ
## 90  INTP
## 91  ENTP
## 92  INTP
## 93  ISFP
## 94  ENFJ
## 95  INFJ
## 96  INFP
## 97  INFJ
## 98  INTJ
## 99  INFJ
## 100 ENFP
##                                                                                                                                                                                                            text
## 1                                                                                                                                                                   'http://www.youtube.com/watch?v=qsXHcwe3krw
## 2                                                                                                                                                     'I'm finding the lack of me in these posts very alarming.
## 3                                                                                                                                                'Good one  _____   https://www.youtube.com/watch?v=fHiGbolFFGw
## 4                 'Dear INTP,   I enjoyed our conversation the other day.  Esoteric gabbing about the nature of the universe and the idea that every rule and social code being arbitrary constructs created...
## 5                                                                                                                                                                                                'You're fired.
## 6                                                                                                                                                                                                    '18/37 @.@
## 7              'No, I can't draw on my own nails (haha). Those were done by professionals on my nails. And yes, those are all gel.  You mean those you posted were done by yourself on your own nails? Awesome!
## 8                          'I tend to build up a collection of things on my desktop that i use frequently and then move them into a folder called  'Everything' from there it get sorted into type and sub type
## 9          I'm not sure, that's a good question. The distinction between the two is so dependant on perception. To quote Robb Flynn, ''The hate you feel is nothing more, than love you feel to win this war.''
## 10                                                                                                                                                                 'https://www.youtube.com/watch?v=w8-egj0y8Qs
## 11        'One time my parents were fighting over my dad's affair and my dad pushed my mom. The fall broke her finger.  She's pointed a gun at him and made him get on his knees and beg for his life. She's...
## 12                                                                                                                                                                 'https://www.youtube.com/watch?v=PLAaiKvHvZs
## 13                                                                                                                                                                                        'Joe santagato - ENTP
## 14   'Fair enough, if that's how you want to look at it. Like I stated before, they were incredibly naive in their comments... However, they think those are things that would help us because those are the...
## 15                                                                                                                                                             'Basically this...  https://youtu.be/1pH5c1JkhLU
## 16                                                                                                                                                'Your comment screams INTJ, bro. Especially the useless part.
## 17                                                        'some of these both excite and calm me:  BUTTS  bodies  brains  community gardens  camping  camping with dogs  hiking with dogs  chillin with animals
## 18         'I think we do agree. I personally don't consider myself Alpha, Beta, or Foxtrot (lol at my own joke). People are people. We both agree that having emotions isn't the same as being weak, whiny,...
## 19     'I fully believe in the power of being a protector, to give a voice to the voiceless. So in that spirit I present this film, and hope it it recieved in the spirit of compassion.  Om Mani Padme Hum ...
## 20                                      'That's normal, it happens also to me. If I am in high mood, I can act like a 478. Depressed, like a 468. Satisfied and relaxed, 451. But the real type of mine is 458.
## 21      'Steve Job's was recognized for his striving for efficiency and practicality. His genius is in his systemization of inventions, less so than in invention. This is where claims of Se and Te come from.
## 22     'It is very annoying to be misinterpreted. Especially with regards to your core, to your intentions and desires. Like when people keep saying that you're in love with somebody for whom you only had...
## 23                                                                                                                          'Now I'm interested. But too lazy to go research it, because it's time-consuming :(
## 24                                                                                                                                                                        '45016 urh sorry uh. couldn't resist.
## 25      'Still going strong at just over the two year mark. I have made noticeable changes and do not plan on slowing. I have attached my 2 year progress picture, but with my face cropped out, you know to...
## 26                                                                                                                                  'Personally, I was thinking this would be more of an SJ type job in a ways.
## 27     'He doesn't want to go on the trip without me, so me staying behind wouldn't be an option for him. I think he really does believe that I'm the one being unreasonable. He still continues to say that...
## 28                                                                                                                                                                                  'They paint without numbers
## 29                                                            'Basically, my main questions are : What do you believe in ? What are the values that matter the most to you ?* (Sorry if I tend to be confusing)
## 30   'I think that that can absolutely be true of infjs, and we shamefully have much potential in that department. Not gonna lie, I am guilty of some unwarranted door slams, and maybe it may seem cruel at...
## 31         '...Is it possible to stop caring about someone entirely?  Well I believe it's possible to stop caring about someone entirely.  If they never cross your mind anymore, then you'd never bother to...
## 32                                                                                                                                   it could be pyroluria.. you know.. it is an ongoing tension inside of you.
## 33     'I'm seriously considering marriage to my longtime ENFP girlfriend. But do you think she'll be able to give me a little more space when we are settled down in marriage? My two biggest problems with...
## 34                                                        'Sometimes I wonder that too.. the reason being that INFJ's seem so absractly deep that even being one myself I don't understand them all the time ;D
## 35                                                                                                                                            https://www.youtube.com/watch?v=AwgF14ySLpw  I do stuff like dis.
## 36                               http://www.youtube.com/watch?v=ipUdoUcNmKI  http://www.youtube.com/watch?v=G9UmSqRZTrs  http://www.youtube.com/watch?v=RJd9kv8cbEo  http://www.youtube.com/watch?v=XRd4-kDlXw8
## 37     'Poker face for sure, accompanied by some sarcasm probably! But inside I'm running a pretty vivid list of pros and cons starting with asking myself 'do I like them back'? I probably know the answer...
## 38                                                                                                                                    'https://www.youtube.com/watch?v=L-AQHLFOk0Y Periphery - Froggin Bullfish
## 39        'Hey ENFPs. I've posted this thread on the philosophy board too, but I am really curious to reading responses from ENFPs in particular.  I've realized that I am quite prone to the following:    ...
## 40         'Hello!  I am working on a presentation by type.  Part of each presentation is feedback from a range of people of the type being reviewed.  I would greatly appreciate it if you could take a few...
## 41                                                                       'I got 593.  From what I've read about the Enneagram I'm a 953, though.  I read somewhere that a lot of 9's mistype themselves as 5's.
## 42           'Trying not to feel totally worthless...  Why do I have to be so sensitive ugh stupid brain.  ...Maybe you never actually gave a fuck.  You don't know the damage you've done...that I've done,...
## 43    Painting the world with the colors of my soul. Interpret it as you like - helping others by volunteering, teaching, giving everything you have.  Personal growth - learning as much about the universe...
## 44   'I'm Type 9 and people in my family (who aren't gut-types) sometimes complain that I 'don't think'. I do feel like I don't really 'think' about certain actions-- I just do them, almost automatically....
## 45                                                                                                      'http://66.media.tumblr.com/fc2b6f0976361f604aafc7fe7affef4f/tumblr_inline_n6wx0lOJ4W1sbbi53.gif (INTJ)
## 46      'Eh... hate the music, the consumerism, a lot of it. The dinners are usually stilted and uncomfortable, the gift-giving disappointing, overall, not my thing. My friends and I usually go out and do...
## 47       'No. If you neglect them, your finances will always be burning on the back of every decision you make, will start to influence your friendships and warp your perceptions of other people and their...
## 48              Bruce Wayne: INFJ Batman persona: ESFP (moral edition) Alfred: ISFJ Rachel: ESFJ Commissioner Gordon: INTP Ra's Al Ghul: ESTJ (messed-up edition) The Joker: ENTP (messed-up edition) Harvey...
## 49      'I love feeling affectionate for the one I love and care for. I care about her very deeply. I want to protect her, make her happy, and always be by her side.  I feel that romantic love is probably...
## 50                                                                                                                                        'Why tell, when I can show... ratchan's PSN Profile - PSNProfiles.com
## 51              'Would be interested in a detailed answer to this question also. Would love to answer properly but I agree and i my view is yes, because I procrastinate every day in many areas of my life....
## 52     'Okay, I meant to create this thread here but I accidentally created it somewhere else, so I'll just copy and paste it here.   Hello everyone, it's been a long time since I've visited this forum. I...
## 53     'I'm currently rooting around in the forum, looking for a place to rant. I think this thread is as good as any!   I have a friend who asks me to go with her to a bunch of events and stuff that I do...
## 54                                                'once you realize you are an INTP. you either will become more INTPish. or instead try to evolve and be more open to emotions (without logical explanations).
## 55                                                                    'I love reading, and I wish I wasn't allergic to dust, so I could read all those beautiful, old, dusty books. I love seeing people smile.
## 56                                                                                                                                                                                                  'ideal you 
## 57                                                                                                                                                                               'Pure sass when it strikes me.
## 58        'That sounds like a beautiful relationship already. But don't push too fast as it seems she needs to be appreciated as a friend. But at the end of the day you can only feel what happens when the...
## 59                                                                                                                      'I have many social screw ups. None of them funny though, mostly mentally traumatizing.
## 60                                                                                                                                    I feel some way about people that can't solve the problem if that counts.
## 61                                                                                                                                                                   'Me: INFJ Mom: ISTJ Dad: ENFJ Sister: ISTJ
## 62              'You're taking life too seriously, bro. Chill.  Also, just be comfortable with yourself and don't hate on others... Hate is not healthy for you. Even more so when you think too much about it.
## 63            Well I have not attended graduate school yet but I am in the same boat as you.  I plan on applying for graduate school in counseling this fall and I have been attempting to do some research....
## 64    'That's an opinion, not a fact.  That being said, I believe in the inherent right of everyone to be as big of an asshole as they want as long as they don't infringe on the rights of others to do the...
## 65       'I believed in God all my life up until about a year ago. My mother was a very strong believer in God and encouraged me and my brothers to be the same way. She didn't force it down our throats or...
## 66    'No offense to any ESTJs that may read this, but the few that I've talked to are obnoxious, loud, lie about shit to try to look cool, and usually talk out of their asses about things they can't back...
## 67                                                         'True, sadly not many have felt like participating in it:unsure:, it could be so helpful if more ISFP's felt like sharing their point of view :wink:
## 68   'I've always thought of Tony Stark as more of an ENTJ... (and it sort of matters to me his type because I've been wondering the type of one of my teachers as a reference point and he's very much like...
## 69   'I would strongly recommend not taking shortcuts.  I feel like whenever you're looking for something too specific you end up missing out on interesting opportunities.  That ESTP who's the life of the...
## 70                                                                                                                                                        'ABILITY TO TRANSFORM.  Form of... a bucket of water!
## 71  'than you may be an ambivert, somewhere in the middle. I read in a book called the Introvert Advantage by Martin Olsen Laney that people who can gain energy by doing both could be an ambivert. You may...
## 72                                                                                                                                                     Last real relationship I've been in was over a year ago.
## 73                                                                                                                                                               '85307 My brothers and I, I'm on the far right
## 74                                                                                                                                                                                'I'm only a mystery to myself
## 75      'Yeah i'm an a-hole too depending on who you are and what you consider one to be.  Nothing wrong with that... just be you. who cares what your supposed to be... who knows maybe your brother is the...
## 76                                                                                                                                      'Add me to the empathetic club. I can also be very expressive at times.
## 77         'Friend: So, you haven't been to the new office yet! Me: No.  I was planning to go to the grand opening but  . . . something happened.   Friend: You really need to work on your social excuses. ...
## 78                                                                                                                                                               'You clearly don't want to move there.  Don't.
## 79    'I suck at keeping in touch with people. No matter how hard I try, or how much I like someone, I only have the social energy to even attempt to stay in touch with about two or three people at a time...
## 80                      'I've heard all my life that you either get Algebra or Geometry. I can't say why that is. Apologies, I was good with Calculus. It was Trig and Geometry, gaaaah! Beat them with sticks!
## 81                                                                                                                                                                                                       Cosmo.
## 82      'Thanks  JayDubs  Miss Bingley LittleDreamer  Your advices are important! :D . And how you deal with a familiar that wants to force you to go to uni? I just can't stand my grandma's cold looks and...
## 83  'Good stuff.  I used cpa excel to study and basically tried to learn a little bit about every sub topic - you can't get too bogged down in the details...if you catch yourself getting bogged down, look...
## 84                                                                                                                                                                                                        'Bump
## 85       'i regret watching the finals for this tourney-- i knew i should of just read about the result after the fact, team i was rooting for totally outclassed... winners played out of their minds... so...
## 86       'I'm bouncing in and out of this thread as my temper allows, I will admit. I'm using my reserves of temper to respond this.  The italicized is unreasonable. That's not going to argued against. On...
## 87                                                                                                                                                             'potentially the most dangerous man in the world
## 88           'i beat that by seeking out a housemate that worked away months at a time, and when he was home, he visited his mates after they finished work, so i was alone 80% of the time :D     oh i dont...
## 89                                                                                  'Newton's Universal Gravity Law. I mean seriously, where would we be if nothing followed that law? Dust particles in space.
## 90     'I'm thinking that you are probably INTP. A lot of your answers are nearly identical to what mine would be (and yes, I know, this is an unscientific way to confirm, but I don't have time to analyze...
## 91  'I know an ENTJ and it's everything I wanted to be. So full of purpose and the drive to execute in the best quality, but intimidating. Some INTJs I met are pretty cool, you can leave them be and still...
## 92      'Software development.  My job is terrible for me because most of it is support-related. I need to be creating something interesting in order to be fulfilled by my work and I can so rarely do that...
## 93        1: Make all the money that goes to unnecessary shit like war and capitalism be re-directed into the health care system. 2: Change food, people should buy local. With all the energy spent to make...
## 94                                                                                                                                                                                              It burns!! Haha
## 95      I hate not being able to afford any real help on my own. I tried using a therapy app and got a response telling me to drink bleach and another saying that I should send pictures of self harm scars...
## 96   'In Udaipur, Rajasthan, where I lived for a few years, squirrels roamed wild over the houses and were barely tolerated by the people. I began feeding the ones in my yard, (corn, bread, nuts) but then...
## 97     'Amelie - though I'm sure someone has mentioned this already  Shutter Island - It's the only movie I can think of right now but it's full of metaphors and has an unpredictable and twisted plot that...
## 98                                                                                                                                                         'https://www.youtube.com/watch?v=8IEQpfA528M  :ball:
## 99                                                                'This.  Also flashbacks to times you've been criticized by others (especially if you feel it was undeserved criticism/you were misunderstood)
## 100                                                                                                         'Learning to say no, the right way, is the greatest talent you have yet to cultivate.  Good luck :)
temp <- sample_n(all_type_sen, 10000)
panc <- data.frame(question_mark=numeric(),exclaim_point=numeric())
for (i in 1:length(temp$type)){
  panc = rbind(panc,spread(
    charfreq(temp$text[i],c("?",'!'), punctuation = TRUE),character,freq))
}
panc$type <- temp$type
panc %>% group_by(type) %>% summarise(mean_question_count = mean(question_mark),mean_exclaim_point_count=mean(exclaim_point)) -> panc_temp
panc_temp%>% ggplot() + geom_bar(aes(x=reorder(type,-mean_question_count),y=mean_question_count,fill=type),stat='identity')+ theme(axis.text.x = element_text(angle = 90, hjust = 1))

as you can see count of using question mark (?) is diffrent between each group. like it seems that Thinking people are using more question mark (?) than Feeling type people . that maybe beacause they ask more. but we can see more variation between personolity type for (exclaim_point) (!) .

panc_temp%>% ggplot() + geom_bar(aes(x=reorder(type,-mean_exclaim_point_count),y=mean_exclaim_point_count,fill=type),stat='identity')+ theme(axis.text.x = element_text(angle = 90, hjust = 1))

as it can be easily seen all F (feeling type) are using more ! punctuation than Thinking people that it could be meaningfull for findyng personolity type.